<template>
  <div>
    <FilterTable
      ref="historyTable"
      height="auto"
      columnsRef="historyTable"
      :columns="tableColumns"
      :datakey="'rows'"
      :fetchapi="fetchApi"
      :params="fetchParams"
      selectionType="single"
      :onColumnsChange="columns => (this.tableColumns = columns)"
    >
    </FilterTable>
  </div>
</template>

<script>
import { queryTrackTask } from '@/api/customerRepair/customerLoss/taskEntry';
import { dictionary } from '@/utils/dictMixin';
export default {
  components: {},
  mixins: [dictionary],
  props: ['getdata'],
  data() {
    return {
      tableColumns: this.createdTableColumns(),
      fetchParams: { VIN: this.getdata[0].VIN, ownerNo: this.getdata[0].ownerNo },
      fetchApi: queryTrackTask
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    // 列表字段
    createdTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          fixed: 'left',
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '结束跟踪',
          dataIndex: 'IS_SELECTED',
          width: 150,
          sorter: true
        },
        {
          title: '车主代码',
          dataIndex: 'OWNER_NO',
          width: 150,
          sorter: true
        },
        {
          title: '车主名称',
          dataIndex: 'OWNER_NAME',
          width: 150,
          sorter: true
        },
        {
          title: 'VIN',
          dataIndex: 'VIN',
          width: 150,
          sorter: true
        },
        {
          title: '品牌',
          dataIndex: 'BRAND_NAME',
          width: 150,
          sorter: true
        },
        {
          title: '车系',
          dataIndex: 'SERIES_NAME',
          width: 150,
          sorter: true
        },
        {
          title: '车型',
          dataIndex: 'MODEL_NAME',
          width: 150,
          sorter: true
        },
        {
          title: '开票日期',
          dataIndex: 'INVOICE_DATE',
          sorter: true,
          filter: true,
          width: 150,
          filterType: 'input',
          dateFormat: 'yyyy-MM-dd'
        },
        {
          title: '性别',
          dataIndex: 'GENDER',
          width: 150,
          sorter: true,
          render: props => {
            return <span>{props.row.GENDER ? this.createDictText(props.row.GENDER, '8012') : ''}</span>;
          }
        },
        {
          title: '地址',
          dataIndex: 'ADDRESS',
          width: 150,
          sorter: true
        },
        {
          title: '联系人电话',
          dataIndex: 'PHONE',
          width: 150,
          sorter: true
        },
        {
          title: '联系人手机',
          dataIndex: 'MOBILE',
          width: 150,
          sorter: true
        },
        {
          title: '省份',
          dataIndex: 'PROVINCE',
          width: 150,
          sorter: true
        },
        {
          title: '城市',
          dataIndex: 'CITY',
          width: 150,
          sorter: true
        },
        {
          title: '区县',
          dataIndex: 'DISTRICT',
          width: 150,
          sorter: true
        },
        {
          title: '问卷名称',
          dataIndex: 'QUESTIONNAIRE_NAME',
          width: 150,
          sorter: true
        },
        {
          title: '跟踪人',
          dataIndex: 'EMPLOYEE_NAME',
          width: 150,
          sorter: true
        },
        {
          title: '跟踪日期',
          dataIndex: 'INPUT_DATE',
          sorter: true,
          filter: true,
          width: 150,
          filterType: 'input',
          dateFormat: 'yyyy-MM-dd'
        },

        {
          title: '跟踪状态',
          dataIndex: 'TRACE_STATUS',
          width: 150,
          sorter: true,
          render: props => {
            return <span>{props.row.TRACE_STATUS ? this.createDictText(props.row.TRACE_STATUS, '8058') : ''}</span>;
          }
        },
        {
          title: 'E_MAIL',
          dataIndex: 'E_MAIL',
          width: 150,
          sorter: true
        },
        {
          title: '车主性质',
          dataIndex: 'OWNER_PROPERTY',
          width: 150,
          sorter: true,
          render: props => {
            return <span>{props.row.OWNER_PROPERTY ? this.createDictText(props.row.OWNER_PROPERTY, '8011') : ''}</span>;
          }
        },
        {
          title: '婚姻状况',
          dataIndex: 'OWNER_MARRIAGE',
          width: 150,
          sorter: true
        },
        {
          title: '家庭月收入',
          dataIndex: 'FAMILY_INCOME',
          width: 150,
          sorter: true
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
          width: 150,
          sorter: true
        }
      ];
    }
  }
};
</script>
<style lang="less" scoped></style>
